import React from 'react'
import PropTypes from 'prop-types'
import { Table } from 'antd'
import classnames from 'classnames'
import queryString from 'query-string'
import styles from './List.less'

const List = ({location, ...tableProps }) => {
  location.query = queryString.parse(location.search)
  return (
    <div>
      <Table
        {...tableProps}
        className={classnames({ [styles.table]: true })}
        scroll={{ x: 700 }}
        rowKey={record => record.id}
      />
    </div>
  )
}

List.propTypes = {
  location: PropTypes.object,
}

export default List
